class Solution {
public:
    int longestContinuousSubstring(string s)
    {
        int ans = 0;
        int n = s.size();
        int i = 0, j = 0;
        for (; i < n; i++) if (s[i] - s[j] != i - j) ans = max(ans, i - j), j = i;
        return max(ans, i - j);
    }
};